const index = 0;
export function head(items: readonly string[]): string {
  // Necessary, since items.length might be 0
  if (items.length) {
    return items[index].toUpperCase();
  } else {
    return '';
  }
}

export function foo(arg: string): void {
  // Necessary, since foo might be ''.
  if (arg) {
  }
}

export function bar(arg?: string | null) {
  // Necessary, since arg might be nullish
  return arg?.length;
}
function head<T>(items: T[]) {
  // Necessary, since items.length might be 0
  if (items.length) {
    return items[0].toUpperCase();
  }
}

function foo(arg: string) {
  // Necessary, since foo might be ''.
  if (arg) {
  }
}

function bar(arg?: string | null) {
  // Necessary, since arg might be nullish
  return arg?.length;
}
